<template>
  <div>
    <el-dialog
      v-model="dialogVisible"
      :title="typePopover.type + '会议信息'"
      width="45%"
      :before-close="handleClose"
      class="dialogStyle"
    >
      <el-form
        :inline="true"
        label-width="100"
        :model="state"
        class="demo-form-inline"
      >
        <el-row>
          <el-col :span="12"
            ><el-form-item label="所属项目">
              <el-select v-model="state.user" placeholder="">
                <el-option label="Zone one" value="shanghai" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="所属部门">
              <el-select v-model="state.user" placeholder="">
                <el-option label="Zone one" value="shanghai" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="申请人">
              <el-input v-model="state.user" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="议题名称">
              <el-input v-model="state.user" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="会议时间">
              <el-input v-model="state.user" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="会议地点">
              <el-input v-model="state.user" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="会议人员">
              <el-input v-model="state.user" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="typePopover.type == '招标会议'">
            <el-form-item label="招标额度">
              <el-input v-model="state.user" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="typePopover.type == '招标会议'">
            <el-form-item label="招标方式">
              <el-input v-model="state.user" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="typePopover.type == '建设项目立项'">
            <el-form-item label="审批">
              <el-input v-model="state.user" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="typePopover.type == '用章用印'">
            <el-form-item label="用途">
              <el-input v-model="state.user" type="textarea" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="议题文件">
              <!-- 上传 -->
              <FileMinioUpload
                @updateFiles="updateFiles"
                businessType=""
                businessId=""
                v-model:files="state.files"
                type="img"
                :restrictionLimit="1"
                :restriction="true"
              ></FileMinioUpload>
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="typePopover.type == '建设项目立项'">
            <el-form-item label="意见">
              <el-input v-model="state.user" type="textarea" placeholder="" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>

      <template #footer>
        <span class="dialog-footer">
          <el-button @click="handleClose" class="button_cancel2">取消</el-button>
          <el-button @click="dialogVisible = false" class="button_view">
            确定
          </el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script setup>
import { ref, reactive, watch } from 'vue'
import { ElDialog, ElRow, ElCol } from 'element-plus'
import FileMinioUpload from "@/components/FileMinioUpload.vue";
const props = defineProps({
  typePopover: {
    type: Object,
    default: {
      type: '查看',
      form: {}
    }
  }
})

const state = reactive({
  user: '',
  files: []
})
const dialogVisible = ref(false)

const handleClose = () => {
  dialogVisible.value = false
}
const open = () => {
  dialogVisible.value = true
  console.log('son', dialogVisible.value)
}

const updateFiles = (list) => {
  state.files = list
  console.log('f', state.files)
}

defineExpose({
  open
})
</script>
<style lang="scss" scoped>
.el-form-item,
.el-select {
  width: 100% !important;
}
</style>
<style lang="scss" scoped>
@import '@/views/constructionProjectManage/static/dialog.scss';
</style>
